<toaster-container></toaster-container>
<div>
	<ol class="breadcrumb">
		您所在的位置：
    	<li><a href="#/index">首页</a></li>
    	<li class="active">修改密码</li>
	</ol>
	<div style="height:60px">
		<ul id="myTab" class="nav nav-tabs">
			<li ng-class="{'active':yhgl}" ng-click="yhglclick()" ng-if="admintype=='SUPER_ADMIN'"><a data-toggle="tab">用户管理</a></li>
			<li ng-class="{'active':xgmm}" ng-click="xgmmclick()"><a data-toggle="tab">修改密码</a></li>
			
		</ul>
	</div>
<div id="myTabContent" >
	<div  ng-if="yhgl" id="yhgl" ng-controller="updatePswController">
		<div class="row">
			 <div class="col-md-12" style="margin: 0 auto;">
			 	<form class="form-inline" role="form" style="width: 980px;">
			 		<div class="form-group ns" style='width:26%;'>
			 			<label for="firstname" class="control-label">名称：</label>
			 			<input type="text" class="form-control" ng-model="$parent.nickname" placeholder="请输入名称">
			 		</div>
			 		<div class="form-group ns" style='width:26%;'>
			 			<label for="firstname" class="control-label">用户名：</label>
			 			<input type="text" class="form-control" ng-model="$parent.username" placeholder="请输入用户名">
			 		</div>
			 		<div class="form-group ns" style="width:24%;line-height: 30px;">
						<label for="firstname" class="control-label">税务机关：</label>
						<a href="" id="authority" ng-click="zTree()" data-toggle="modal" data-target="#zTreeModal">全部</a>
						<input type="hidden" id="taxCode"  ng-model="$parent.authorityCode" class="form-control" >
					</div>
					
			 		<button type="button" ng-click="userList()" class="btn btn-primary nsbtn">
			 	       		<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
			 	        	<i class="icon-search"></i>查询
			 	   </button>
			 	   &emsp;
			 	    <button type="button"  class="btn btn-primary nsbtn" data-toggle="modal" data-target="#addUserModal">
			 	       		<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
			 	        	<i class="icon-search"></i>新增用户
			 	    </button>
			 		<!---->
			 		
			 	</form>
			</div>
		</div>
		<div class="row"  >
			 <div class="col-md-12" style="margin: 0 auto;">
			 	<table class="table table-hover">
			 		<thead>
			 			<tr>
			 				<th>名称</th>
			 				<th>用户名</th>
			 				<th>创建时间</th>
			 				<th>所属机关</th>
			 				<th>最近一次登录</th>
			 				<th>状态</th>
			 				<th ng-if="userType=='SUPER_ADMIN'">操作</th>
			 			</tr>
			 		</thead>
			 		<tbody>
			 			<tr ng-repeat="data in userslist">
			 				<td>{{data.nickname}}</td>
			 				<td>{{data.username}}</td>
			 				<td>{{data.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
			 				<td>{{data.officeAbbr}}</td>
			 				<td>{{data.loginTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
			 				<td>
			 					<span ng-if="data.state==1" style="color:#21da21">正常</span>
			 					<span ng-if="data.state==0" style="color:#a7a3a3">冻结</span>
			 				</td>
			 				<td ng-if="userType=='SUPER_ADMIN'">
								<a href="javascript:void(0)" ng-click="freeze(data.id)" ng-if="data.state==1">
          							<span class="glyphicon glyphicon-trash"></span>&nbsp;冻结
        						</a>
        						<a href="javascript:void(0)" ng-click="strta(data.id)" ng-if="data.state==0">
          							<span class="glyphicon glyphicon-cog"></span>&nbsp;启用
        						</a>
        						&emsp;
        						<a href="javascript:void(0)" ng-click="getUserById(data.id)" data-toggle="modal" data-target="#updateUserModal" ng-if="data.state==1">
          							<span class="glyphicon glyphicon-pencil"></span>&nbsp;编辑
        						</a>
							</td>
			 			</tr>
			 			
			 		</tbody>
			 	</table>
			</div>
			<pagination count="count"  page="page" pagesize="pagesize" refresh="userList()"></pagination>
		</div>
	</div>
	
	<div  ng-if="xgmm" id="xgmm" >
		<div class="row">
			<div class="col-md-4" ></div>
			 <div class="col-md-4" style="margin: 0 auto;margin-top: 80px;">
				<form class="bs-example bs-example-form" role="form">
					<P>密码至少要包含数字、字母、字符三种类型中的两种，且数字不能开头</P>
					<div class="input-group input-group-lg">
						<span class="input-group-addon">旧密码</span>
						<input id="oldpwd" type="password" ng-model="$parent.pwd1" class="form-control" placeholder="请输入旧密码">
					</div>
					<p id="yuan" style="color:red;margin: 5px;"></p>
					<br>
					<div class="input-group input-group-lg">
						<span class="input-group-addon">新密码</span>
						<input type="password" id="password"  ng-model="$parent.pwd2" class="form-control" placeholder="请输入新密码">
					</div>
					
					<br>
					<div class="input-group input-group-lg">
						<span class="input-group-addon">确认密码</span>
						<input type="password" id="password2" class="form-control" ng-model="$parent.pwd3" placeholder="请确认新密码" ng-change="paw()">
					</div>
					<p id="mimaxiangtong" style="color:red;margin: 5px;display: none;" >新密码不能与旧密码相同！</p>
					<p id="psw2" style="color:red;margin: 5px;display: none;" >两次输入密码不相同,请核对！</p>
					<p id="mimaqiangdu" style="color:red;margin: 5px;display: none;" >密码强度不够，请核查</p>
					<p id="mimachangdu" style="color:red;margin: 5px;display: none;" >密码长度请不要少于6位，不要超过16位</p>
				</form>
				
			</div>
			<div class="col-md-4" >
			</div>
		</div>
		<div class="row">
			<div class="col-md-4" ></div>
			 <div class="col-md-4" style="margin: 0 auto;margin-top: 80px;text-align: center;">
				<button  type="button" ng-click="save()" class="btn btn-primary nsbtn" style="width:120px;height:50px;font-size: 22px;">
        			<i class="icon-search"></i>确&emsp;定
    			</button>
			</div>
			<div class="col-md-4"></div>
		</div>
	</div>
	
</div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="addUserModal" tabindex="-1" role="dialog" aria-labelledby="addUserModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
               <!-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>-->
                <h4 class="modal-title" id="addUserModalLabel">新增用户</h4>
            </div>
            <div class="modal-body">    
            	
            	<form class="form-horizontal" role="form">
            		<div class="form-group">
            			<label for="firstname" class="col-sm-3 control-label">名称</label>
            			<div class="col-sm-9">
            				<input type="text" class="form-control" ng-model="$parent.nickname2" placeholder="请输入名称">
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">用户名</label>
            			<div class="col-sm-9">
            				<input type="text" class="form-control" ng-model="$parent.username2" placeholder="请输入用户名">
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">密码</label>
            			<div class="col-sm-9">
            				<input type="password" class="form-control" id="addpaw1" ng-model="$parent.password2" placeholder="至少包含数字、字母、字符三种类型中的两种，且数字不能开头">
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">确定密码</label>
            			<div class="col-sm-9">
            				<input type="password" class="form-control" id="addpaw2"ng-model="$parent.password3" ng-change="addpaw()" placeholder="请再次输入密码">
            				<p id="pawno" style="color:red;display: none;">* 两次密码不相同</p>
            				<p id="mimaqiangdu" style="color:red;margin: 5px;display: none;" >密码强度不够，请核查</p>
							<p id="mimachangdu" style="color:red;margin: 5px;display: none;" >密码长度请不要少于6位，不要超过16位</p>
            			</div>
            			
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">类型</label>
            			<div class="col-sm-9">
            				<select class="form-control" ng-model="$parent.type" style="height: 35px;">
            					<option value="SYSTEM_ADMIN">普通用户</option>
            					<option value="SUPER_ADMIN">系统管理员</option>
            				</select>
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">所属机关：</label>
            			<div class="col-sm-9" style="line-height: 30px;">
            				<a href="" id="authority2" ng-click="zTree(1)" data-toggle="modal" data-target="#zTreeModal">全部</a>
            				<input type="hidden" id="authCode" ng-model="$parent.authCode">
            				<input type="hidden" id="authLevel"  ng-model="$parent.authLevel">
            			</div>
            		</div>
            		<!--<div>
            			<div class="form-group ns" style="width:24%;line-height: 30px;">
						<label for="firstname" class="control-label">税务机关：</label>
						<a href="" id="authority" ng-click="zTree()" data-toggle="modal" data-target="#zTreeModal">全部</a>
						<input type="hidden" id="taxCode"  ng-model="$parent.authorityCode" class="form-control" >
					</div>-->
            	</form>
            	
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" ng-click="addUser()">保存</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- 模态框（Modal） -->
<div class="modal fade" id="updateUserModal" tabindex="-1" role="dialog" aria-labelledby="updateUserModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
               <!-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>-->
                <h4 class="modal-title" id="updateUserModalLabel">编辑用户</h4>
            </div>
            <div class="modal-body">    
            	
            	<form class="form-horizontal" role="form">
            		<div class="form-group">
            			<label for="firstname" class="col-sm-3 control-label">名称</label>
            			<div class="col-sm-9">
            				<input type="text" class="form-control" id="nicknames" ng-model="$parent.nicknames"  placeholder="请输入名称">
            				<input type="hidden" class="form-control" id="ids" ng-model="$parent.ids" >
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">用户名</label>
            			<div class="col-sm-9">
            				<input type="text" class="form-control"id="usernames" ng-model="$parent.usernames" placeholder="请输入名称">
            			</div>
            		</div>
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">密码</label>
            			<div class="col-sm-9">
            				<input type="password" class="form-control" id="passwords" disabled ng-model="$parent.passwords" placeholder="请输入密码">
            			</div>
            		</div>
            		<!--<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">确定密码</label>
            			<div class="col-sm-9">
            				<input type="password" class="form-control" id="addpaw2" placeholder="请再次输入密码">
            				<p id="pawno" style="color:red;display: none;">* 两次密码不相同</p>
            			</div>
            			
            		</div>-->
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">类型</label>
            			<div class="col-sm-9">
            				<select class="form-control" ng-model="$parent.types" id="types" style="height: 35px;">
            					<option value="SYSTEM_ADMIN">普通用户</option>
            					<option value="SUPER_ADMIN">系统管理员</option>
            				</select>
            			</div>
            		</div>
            		
            		<div class="form-group">
            			<label for="lastname" class="col-sm-3 control-label">所属机关：</label>
            			<div class="col-sm-9" style="line-height: 30px;">
            				<a href="" id="updateAuthority" ng-click="zTree(2)" data-toggle="modal" data-target="#zTreeModal">全部</a>
            				<input type="hidden"  id="updateOfficeId" >
            				<input type="hidden"  id="updateAuth" >
            			</div>
            		</div>
            	</form>
            	
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" ng-click="updateUser()">保存</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- 模态框（Modal） -->
<div class="modal fade" id="zTreeModal" tabindex="-1" role="dialog" aria-labelledby="zTreeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" style="">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">税务机关选择</h4>
            </div>
            <div class="modal-body" style="height:400px;overflow: scroll;">
            	<ul id="treeDemo" class="ztree"></ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" ng-click="zTreeclick()">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>